// 系统相关类型定义
import { ID } from './common';
export enum ScheduleType {
  HOLIDAY = 1, // 节假日
  WORKDAY = 2, // 调休日
  WEEKEND = 3, // 正常周末
}


export enum ScheduleStatus {
  AUTOUPDATE = 1, // 自动更新
  MANUALUPDATE = 0, // 手动更新
}
// 统计数据
export interface StatisticsData {
  totalUsers: number;
  totalInstruments: number;
  totalOrders: number;
  totalRevenue: number;
  todayOrders: number;
  todayRevenue: number;
  activeUsers: number;
  onlineInstruments: number;
  pendingOrders: number;
  completedOrders: number;
}

// 通知信息
export interface NotificationInfo {
  id: ID;
  title: string;
  content: string;
  type: string;
  priority: string;
  isRead: boolean;
  userId?: ID;
  targetUrl?: string;
  createdAt: string;
  readAt?: string;
}

// 系统设置
export interface SystemSettings {
  siteName: string;
  siteDescription: string;
  logo?: string;
  favicon?: string;
  contactEmail: string;
  contactPhone: string;
  address: string;
  workingHours: string;
  maintenanceMode: boolean;
  registrationEnabled: boolean;
  emailNotifications: boolean;
  smsNotifications: boolean;
  autoApproval: boolean;
  maxBookingDays: number;
  minBookingHours: number;
  cancellationDeadline: number;
  refundPolicy: string;
  privacyPolicy: string;
  termsOfService: string;
}

// 操作日志
export interface OperationLog {
  id: ID;
  userId: ID;
  userName: string;
  action: string;
  resource: string;
  resourceId?: ID;
  details?: Record<string, unknown>;
  ip: string;
  userAgent: string;
  createdAt: string;
}

// 首页配置
export interface HomeConfig {
  // Banner配置
  banners: {
    id: string;
    image: string;
    link?: string;
    order: number;
  }[];
  
  // 推荐仪器配置
  recommendedInstruments: string[]; // 仪器ID列表
  
  // 通知配置
  notification: string;
  
  // 二维码配置
  consultQrCode: string; // 全局咨询二维码
  financeQrCode: string; // 财务二维码
}

// 通知消息
export interface NotificationMessage {
  id: string;
  title: string;
  content: string;
  type: 'order_new' | 'order_status_change' | 'system_notice';
  targetUserId?: string;
  targetUserRole?: string;
  orderId?: string;
  isRead: boolean;
  createdAt: string;
}

// 系统统计数据
export interface SystemStatistics {
  totalUsers: number;
  totalInstruments: number;
  totalOrders: number;
  todayOrders: number;
  monthlyRevenue: number;
  instrumentUtilization: number;
}

// 文件上传响应
export interface UploadResponse {
  url: string;
  filename: string;
  size: number;
}

// ============ 行政区域相关类型 ============

// 行政区域查询请求
export interface RegionQueryRequest {
  parentCode?: string; // 上级行政编号
}

// 行政区域基础对象
export interface Region {
  ancestors: string; // 祖区划编号
  cityCode: string; // 市级区划编号
  cityName: string; // 市级名称
  code: string; // 区划编号
  districtCode: string; // 区级区划编号
  districtName: string; // 区级名称
  level: number; // 层级
  name: string; // 区划名称
  parentCode: string; // 父区划编号
  provinceCode: string; // 省级区划编号
  provinceName: string; // 省级名称
  remark: string; // 备注
  sort: number; // 排序
  townCode: string; // 镇级区划编号
  townName: string; // 镇级名称
  villageCode: string; // 村级区划编号
  villageName: string; // 村级名称
}

// 行政区域VO对象（带子节点信息）
export interface RegionVO extends Region {
  hasChildren: boolean; // 是否存在子节点: true 存在;false 不存在
  children?: RegionVO[]; // 子节点列表
} 


export interface InstrumentScheduleParams {
  startDate: string;
  endDate: string;
}

export interface InstrumentScheduleSpecificDateParams {
  id: number;
  year: number;
  month: number;
  day: number;
  type: ScheduleType; // 1=节假日 2=调休日 3=正常周末
  createTime: string;
  updateTime: string;
  status: ScheduleStatus; // 1=正常 2=禁用
  holidayDate: string;
}